#!/usr/bin/env python3
"""Academic Wellbeing Analysis Script
Author: Juan Moises de la Serna
"""
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

df = pd.read_csv('burnout_by_role.csv')
print(df.groupby('role')['burnout_high_pct'].mean())

sns.barplot(data=df, x='role', y='burnout_high_pct', hue='year')
plt.title('High Burnout Rate by Academic Role')
plt.ylabel('% with High Burnout')
plt.xticks(rotation=30)
plt.tight_layout()
plt.savefig('burnout_by_role.png', dpi=150)
